fix: refresh empty change-object actions#340
Open
hjotha wants to merge 2 commits intomendixlabs:mainfrom
Open
Conversation
Symptom: executing MDL that describes an empty change-object activity could create a model that fails Studio Pro validation with CE0032 because the action had no items and did not commit the object. Root cause: the MDL syntax represents an empty change action as `change $Object;`, but the builder always wrote RefreshInClient=false for change-object actions. For an empty non-committing change, Studio Pro requires the refresh flag to make the activity valid. Fix: set RefreshInClient=true when building a change-object action with no member changes. Change actions with explicit member assignments keep their previous refresh behavior. Tests: add a builder regression test that constructs an empty change statement and asserts that the resulting ChangeObjectAction refreshes in client.
Symptom: the empty change-object fix relies on RefreshInClient=true even though the CE0032 text mentions only missing items and commit state. Root cause: the Studio Pro validator accepts refresh-only empty changes, but that behavior is not obvious from public docs or the CE0032 wording. Fix: add an executable bug-test fixture for issue mendixlabs#339 and document the mx check behavior directly beside the builder inference. Tests: `./bin/mxcli check mdl-examples/bug-tests/339-empty-change-refresh-in-client.mdl` and `go test ./mdl/executor -run TestEmptyChangeObjectRefreshesInClient`.
Contributor
Author
|
Addressed the review follow-up in
I am keeping the separate concern of preserving explicit RefreshInClient on change actions with member assignments out of this PR; that needs a syntax/design decision for a |
AI Code ReviewCritical IssuesNone found. Moderate IssuesNone found. Minor Issues
What Looks Good
RecommendationApprove. The PR correctly resolves the reported issue with appropriate tests and minimal, well-documented code changes. No blocking concerns identified. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
34 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RefreshInClientwhen rebuildingchange $Object;with no member assignmentsWhy
An empty, non-committing
ChangeObjectActionwithout refresh is invalid in Studio Pro and reports CE0032. Existing models can use empty change activities as refresh-only actions, and the MDL form currently has no explicitrefreshmodifier forchangestatements, so the builder needs to preserve validity by inferring refresh for empty changes.Validation
make buildmake lint-gomake testCloses #339.
Related to #332.